package cn.com.dcsgo.springcloudstudy.rule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 当前客户端自定义的服务调用规则——随机
 *
 * @author Dcsgo
 * @since 2024-08-03
 */
@Configuration
public class MyselfRule {
    @Bean
    public IRule myRule() {
        //定义为随机
        return new RandomRule();
    }
}
